<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Remote Control: RemoteControl Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Remote Control
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_remote_control.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_remote_control-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">RemoteControl Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="class_remote_control.html" title="RemoteControl is able to remotely command devices it is programmed for.">RemoteControl</a> is able to remotely command devices it is programmed for.  
 <a href="class_remote_control.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_remote_control_8h_source.html">RemoteControl.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for RemoteControl:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_remote_control.png" usemap="#RemoteControl_map" alt=""/>
  <map id="RemoteControl_map" name="RemoteControl_map">
<area href="class_object.html" title="Common Baseclass for all other classes." alt="Object" shape="rect" coords="0,0,94,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab044b23a3d09877df6d905949881da4a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#ab044b23a3d09877df6d905949881da4a">RemoteControl</a> ()</td></tr>
<tr class="memdesc:ab044b23a3d09877df6d905949881da4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">CTor of class <a class="el" href="class_remote_control.html" title="RemoteControl is able to remotely command devices it is programmed for.">RemoteControl</a>.  <a href="#ab044b23a3d09877df6d905949881da4a"></a><br/></td></tr>
<tr class="separator:ab044b23a3d09877df6d905949881da4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2458bb7cbe0a6cf7273424db89fb4508"><td class="memItemLeft" align="right" valign="top">std::string const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#a2458bb7cbe0a6cf7273424db89fb4508">GetDeviceName</a> (size_t slotNr) const </td></tr>
<tr class="memdesc:a2458bb7cbe0a6cf7273424db89fb4508"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to return the name of a programmed device.  <a href="#a2458bb7cbe0a6cf7273424db89fb4508"></a><br/></td></tr>
<tr class="separator:a2458bb7cbe0a6cf7273424db89fb4508"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44913ef89c611945305dadb6654c3cc8"><td class="memItemLeft" align="right" valign="top">size_t const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#a44913ef89c611945305dadb6654c3cc8">GetNrOfSlots</a> () const </td></tr>
<tr class="memdesc:a44913ef89c611945305dadb6654c3cc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to return the number of slots.  <a href="#a44913ef89c611945305dadb6654c3cc8"></a><br/></td></tr>
<tr class="separator:a44913ef89c611945305dadb6654c3cc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a296a8af782828f843ececaa87818a640"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#a296a8af782828f843ececaa87818a640">OffButtonPressed</a> (size_t slotNr)</td></tr>
<tr class="memdesc:a296a8af782828f843ececaa87818a640"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to execute the off command of a slot.  <a href="#a296a8af782828f843ececaa87818a640"></a><br/></td></tr>
<tr class="separator:a296a8af782828f843ececaa87818a640"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a597aacc1c1877558971d2c2543639b65"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#a597aacc1c1877558971d2c2543639b65">OnButtonPressed</a> (size_t slotNr)</td></tr>
<tr class="memdesc:a597aacc1c1877558971d2c2543639b65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to execute the on command of a slot.  <a href="#a597aacc1c1877558971d2c2543639b65"></a><br/></td></tr>
<tr class="separator:a597aacc1c1877558971d2c2543639b65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a215c1c39d975a140fad40eda0b2b6301"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#a215c1c39d975a140fad40eda0b2b6301">ProgramSlot</a> (size_t slotNr, <a class="el" href="class_i_command.html">ICommand</a> *onCmd, <a class="el" href="class_i_command.html">ICommand</a> *offCmd, std::string const devname)</td></tr>
<tr class="memdesc:a215c1c39d975a140fad40eda0b2b6301"><td class="mdescLeft">&#160;</td><td class="mdescRight">Program a slot of the remote control.  <a href="#a215c1c39d975a140fad40eda0b2b6301"></a><br/></td></tr>
<tr class="separator:a215c1c39d975a140fad40eda0b2b6301"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1500060c997a241ec2eead37b625b3de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_remote_control.html#a1500060c997a241ec2eead37b625b3de">UndoButtonPressed</a> ()</td></tr>
<tr class="memdesc:a1500060c997a241ec2eead37b625b3de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Undo the last executed command.  <a href="#a1500060c997a241ec2eead37b625b3de"></a><br/></td></tr>
<tr class="separator:a1500060c997a241ec2eead37b625b3de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_object"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_object')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_object.html">Object</a></td></tr>
<tr class="memitem:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_object.html#aa3e791419d84c4c346ef9499513b8e00">~Object</a> ()</td></tr>
<tr class="memdesc:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">DTor of the <a class="el" href="class_object.html" title="Common Baseclass for all other classes.">Object</a> class.  <a href="#aa3e791419d84c4c346ef9499513b8e00"></a><br/></td></tr>
<tr class="separator:aa3e791419d84c4c346ef9499513b8e00 inherit pub_methods_class_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_class_object"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_class_object')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="class_object.html">Object</a></td></tr>
<tr class="memitem:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_object.html#a86a84ed2d1207e5f8827165ac2941106">deleteObject</a> (<a class="el" href="class_object.html">Object</a> *obj)</td></tr>
<tr class="memdesc:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees the memory used by obj.  <a href="#a86a84ed2d1207e5f8827165ac2941106"></a><br/></td></tr>
<tr class="separator:a86a84ed2d1207e5f8827165ac2941106 inherit pub_static_methods_class_object"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_remote_control.html" title="RemoteControl is able to remotely command devices it is programmed for.">RemoteControl</a> is able to remotely command devices it is programmed for. </p>
<p>The class <a class="el" href="class_remote_control.html" title="RemoteControl is able to remotely command devices it is programmed for.">RemoteControl</a> has 6 programmable slots for 6 devices. At construction, all slots are assigned with the <a class="el" href="class_no_command.html" title="Header for the ICommand interfaceclass.">NoCommand</a> object (does nothing). A slot can be overwritten (no warning will occur). It is able to call certain commands when the "ON" button is pressed or when the "OFF" button is pressed and it can also undo the last executed command.</p>
<dl class="section author"><dt>Author</dt><dd>Andreas Lehner </dd></dl>
<dl class="section date"><dt>Date</dt><dd>25.11.2012 </dd></dl>

<p>Definition at line <a class="el" href="_remote_control_8h_source.html#l00038">38</a> of file <a class="el" href="_remote_control_8h_source.html">RemoteControl.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ab044b23a3d09877df6d905949881da4a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RemoteControl::RemoteControl </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>CTor of class <a class="el" href="class_remote_control.html" title="RemoteControl is able to remotely command devices it is programmed for.">RemoteControl</a>. </p>
<p>In the constructor every slot is assigned with a <a class="el" href="class_no_command.html" title="Header for the ICommand interfaceclass.">NoCommand</a> object, which is doing nothing. The on and the off command will be affected. It also sets the number of slots a remote control has (6). </p>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00004">4</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a2458bb7cbe0a6cf7273424db89fb4508"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string const RemoteControl::GetDeviceName </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>slotNr</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to return the name of a programmed device. </p>
<p>This function returns the name of a device at a certain slot and is used for output. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">exception</td><td>If the committed slot number is higher than mNrOfSlots-1 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::string The name of the device </dd></dl>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00075">75</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a44913ef89c611945305dadb6654c3cc8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t const RemoteControl::GetNrOfSlots </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to return the number of slots. </p>
<p>This function returns the number of the slots of a remote control. This value is set internally while construction. </p>
<dl class="section return"><dt>Returns</dt><dd>size_t The number of slots </dd></dl>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00071">71</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a296a8af782828f843ececaa87818a640"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RemoteControl::OffButtonPressed </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>slotNr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to execute the off command of a slot. </p>
<p>The off command of the given slot is output and this command is set as the last command for undoing it. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slotNr</td><td>The slot number where the command is executed </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">exception</td><td>If the committed slot number is higher than mNrOfSlots-1 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00034">34</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a597aacc1c1877558971d2c2543639b65"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RemoteControl::OnButtonPressed </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>slotNr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function to execute the on command of a slot. </p>
<p>The on command of the given slot is output and this command is set as the last command for undoing it. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slotNr</td><td>The slot number where the command is executed </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">exception</td><td>If the committed slot number is higher than mNrOfSlots-1 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00019">19</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a215c1c39d975a140fad40eda0b2b6301"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RemoteControl::ProgramSlot </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>slotNr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_i_command.html">ICommand</a> *&#160;</td>
          <td class="paramname"><em>onCmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_i_command.html">ICommand</a> *&#160;</td>
          <td class="paramname"><em>offCmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string const&#160;</td>
          <td class="paramname"><em>devname</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Program a slot of the remote control. </p>
<p>The slot of the remote control will be programmed by setting its on and its off command. If the slot is currently programmed by other commands they will be overwritten. Also the device name will be set to give the programmed slot a name for later output as there maybe more than one <a class="el" href="class_t_v.html" title="Header for the TV class.">TV</a>'s why the ability for naming them differently is given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">slotNr</td><td>The slot number where the commands will be programmed </td></tr>
    <tr><td class="paramname">onCmd</td><td>The on command of the slot </td></tr>
    <tr><td class="paramname">offCmd</td><td>The off command of the slot </td></tr>
    <tr><td class="paramname">devname</td><td>The name of the device that will execute the commands </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">exception</td><td>If the committed slot number is higher than mNrOfSlots-1 </td></tr>
    <tr><td class="paramname">exception</td><td>If the pointers of onCmd and/or offCmd is 0 </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00054">54</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a1500060c997a241ec2eead37b625b3de"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RemoteControl::UndoButtonPressed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Undo the last executed command. </p>
<p>The last command is saved in a member for which execute is called. </p>

<p>Definition at line <a class="el" href="_remote_control_8cpp_source.html#l00047">47</a> of file <a class="el" href="_remote_control_8cpp_source.html">RemoteControl.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_remote_control.html">RemoteControl</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
